package com.zyp.shop.controller;

import com.zyp.shop.service.TestService;
import com.zyp.shop.vo.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by Intellij IDEA
 *
 * @author 赵雅璞
 * @Date: 2022/11/17 12:08
 * @Version 1.0
 */
@RestController
public class TestController {
    @Resource(name = "TestService")
    private TestService testService;

    @GetMapping("testInsert")
    public Result test(){
        return new Result(200,"添加学生",testService.insertTest());
    }
    @GetMapping("selectAll")
    public Result select(){
        return new Result(200,"查询所有学生",testService.selectAllStudents());
    }
    @GetMapping("update")
    public Result update(){
        return new Result(200,"修改学生",testService.updateStudent());
    }
    @GetMapping("delete")
    public Result delete(){
        return new Result(200,"开除学生",testService.deleteStudent());
    }

}
